<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Global</title>
    <script>
        /*
            Global
                1.特点：全局对象，这个Global中封装的方法不需要对象就可以直接调用
                2.方法：
                    - encodeURI():url编码
                    - decodeURI():url解码

                    - encodeURIComponent():url编码
                    - decodeURIComponent():url解码
        */
        //var str = "迷失之牙";
        var str = "http://www.baidu.com?wd=迷失之牙";
        var encode = encodeURI(str);
        document.write(encode + "<br>");
        var decode = decodeURI(encode);
        document.write(decode + "<br>");

        //var str = "迷失之牙";
        var str = "http://www.baidu.com?wd=迷失之牙";
        var encode1 = encodeURIComponent(str);
        document.write(encode1 + "<br>");
        var decode1 = decodeURIComponent(encode1);
        document.write(decode1 + "<br>");

        var str = "1234Gnar";
        var num = parseInt(str);
        document.write((num + 1) + "<br>");

        var a = "NaN";
        document.write(isNaN(a));

        var jscode = "alert(123)";
        alert(jscode);
        eval(jscode);
    </script>
</head>
<body>

</body>
</html>